package com.recruit.g1.resume.config;  // 根据你的实际包结构调整

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // Windows路径写法（注意斜杠方向）
        registry.addResourceHandler("/files/**")
                .addResourceLocations("file:D:/files/")  // 冒号后直接跟斜杠
                .setCachePeriod(3600);

        // 如果部署到Linux服务器需要额外添加（可选）
        // registry.addResourceHandler("/files/**")
        //         .addResourceLocations("file:/home/files/");
    }
}